home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 114 / macaddict114.cdr / Software / Utilities / macam.0.8.4.dmg / macam sources / utilities / RGBScaler.h < prev    next >
Encoding:
Text File  |  2002-07-08  |  2.0 KB  |  60 lines

  1. /*
  2.  MyRGBScaler.h - image blitter with linear interpolation scaling and RGB/ARGB conversion
  3.  
  4.  Copyright (C) 2002 Matthias Krauss (macam@matthias-krauss.de)
  5.  
  6.  This program is free software; you can redistribute it and/or modify
  7.  it under the terms of the GNU General Public License as published by
  8.  the Free Software Foundation; either version 2 of the License, or
  9.  (at your option) any later version.
  10.  
  11.  This program is distributed in the hope that it will be useful,
  12.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  GNU General Public License for more details.
  15.  
  16.  You should have received a copy of the GNU General Public License
  17.  along with this program; if not, write to the Free Software
  18.  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  19.  
  20.  $Id: RGBScaler.h,v 1.1 2002/07/08 22:33:30 mattik Exp $
  21.  */
  22.  
  23. #import <Cocoa/Cocoa.h>
  24.  
  25.  
  26. @interface RGBScaler : NSObject {
  27.     unsigned char* internalDst;        //A blitting target provided by the scaler
  28.     unsigned char* tmpRow1;        //An interpolated line (always ARGB)
  29.     unsigned char* tmpRow2;        //Another interpolated line (always ARGB)
  30.     //Although there are two tmp rows, there's only one block of memory allocated for them to avoid cache misses
  31.     int srcWidth;
  32.     int srcHeight;
  33.     int srcBPP;                //3=RGB, 4=ARGB
  34.     int srcRB;
  35.     int dstWidth;
  36.     int dstHeight;
  37.     int dstBPP;                //3=RGB, 4=ARGB
  38.     int dstRB;
  39. }
  40.  
  41. - (id) init;
  42. - (void) dealloc;
  43.  
  44. - (BOOL) setSourceWidth:(int)sw height:(int)sh bytesPerPixel:(int)sbpp rowBytes:(int)srb;
  45. - (int) sourceWidth;
  46. - (int) sourceHeight;
  47. - (int) sourceBytesPerPixel;
  48. - (int) sourceRowBytes;
  49.  
  50. - (BOOL) setDestinationWidth:(int)dw height:(int)dh bytesPerPixel:(int)dbpp rowBytes:(int)drb;
  51. - (int) destinationWidth;
  52. - (int) destinationHeight;
  53. - (int) destinationBytesPerPixel;
  54. - (int) destinationRowBytes;
  55.  
  56. - (unsigned char*) convert:(unsigned char*)src;
  57. - (void) convert:(unsigned char*)src to:(unsigned char*)dst;
  58.  
  59. @end
  60.